package demo2;

public class Dog {
    String bread;   // 品种
    int size;  // 大小
    String color;  // 颜色
    int age;  // 年龄

    public void initialization(){
        bread = "哈士奇";
        size = 3;
        color = "黑色";
        age = 2;
    }

    void eat(){
        System.out.println("狗在吃骨头");
    }

    void run(){
        System.out.println("狗在跑");
    }

    void sleep(){
        System.out.println("狗在睡觉");
    }

    void name() {
        System.out.println("狗的名字是旺财");
    }

    public static void main(String[] args) {
        Dog dog = new Dog();
        // 初始化
        dog.initialization();
        dog.color = "white";
        dog.size = 4;
        dog.age = 2;
        dog.bread = "金毛";
        System.out.println(dog.color);
        System.out.println(dog.size);
        System.out.println(dog.age);
        System.out.println(dog.bread);
        dog.eat();
        dog.run();
        dog.sleep();
        dog.name();
    }
}
